<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<script type="text/javascript">
	function submitComment() {
		var c = $("#commentContent").val();
		if (c == "" || c == undefined) {
			alert("请填写您的留言内容！");
			return false;
		}
		$("#processBtn").html("提交中...");
		$("#commentForm").submit();

		return true;
	}
</script>


<div class="ui-body ">
<div class="code_comments code_module">

	<h2>
		</span> <a name="comments">处理过程</a>
	</h2>
</div>
    <div class="comments">
		<ul>
			<c:forEach items="${historys}" var="commentary" varStatus="status">

				<c:set var="sIndex" value="${sIndex+1 }"></c:set>
				<li class="row_${(sIndex)%2 }">
					<table>
						<tr>
							<td class="portrait"><c:choose>
									<c:when test="${empty commentary.photo }">
										<img src="img/elements/profile/avatar.png">
									</c:when>
									<c:otherwise>
										<img src="${commentary.photo}">
									</c:otherwise>
								</c:choose></td>
							<td class="body">
								<div class="r_title t_${commentary.task_def_key}">
									<b>${commentary.fullname}</b>
									<fmt:formatDate value="${commentary.action_time}"
										pattern="yyyy-MM-dd HH:mm:ss" />
									&nbsp;在“${commentary.name_}”执行“${commentary.action_name}”
									<div class="r_content TextContent">
										处理意见：${commentary.comment} <br>
									</div>
								</div>
						</tr>
					</table></li>



			</c:forEach>

		</ul>

	</div>
	
	<div class="code_comments code_module">

	<h2>
		</span> <a name="comments">事件描述</a>
	</h2>
</div>


	<h4 class="ui-title">${model.title}（${model.status}）</h4>
	<div class="small-title">事件描述：${model.description}</div>
	<div class="small-title">
		相关附件：
		<c:forEach items="${uploadFiles }" var="file">
			<a target="_blank" href="${file.path }">${file.name }</a>(大小：${file.size/1000 }KB)
	&nbsp;&nbsp;</c:forEach>
	</div>
</div>
<div class="code_comments code_module">

	<h2>
		</span> <a name="comments">相关留言<strong>(<c:out
					value="${fn:length(messages)}"></c:out>)</strong> </a>
	</h2>
</div>
<div class="comments">
	<ul>
		<c:forEach items="${messages}" var="commentary" varStatus="status">
			<li class="row_${(status.index)%2 }">
				<table>
					<tr>
						<td class="portrait"><img
							src="img/elements/profile/avatar.png"></td>
						<td class="body">
							<div class="r_title">
								<b>${commentary.creatorName}</b> 发表于
								<fmt:formatDate value="${commentary.createDate}"
									pattern="yyyy-MM-dd HH:mm" />

								<div class="r_content TextContent">
									${commentary.content} <br>
								</div>
							</div>
					</tr>
				</table></li>
		</c:forEach>

	</ul>

</div>
<div class="title">我要留言</div>

<form id="commentForm" method="post"
	action="customer/help/incident/saveLeaveMessage">
	<input type="hidden" name="id" value="${model.id}">
	<p>
		<textarea id="commentContent" name="content" rows="6"
			style="width:80%"></textarea>
		<span class="required-tip"><font color="red"> * </font><font
			color="blue">必填 </font> </span>
	</p>
	<div id="processBtn" style="text-align: center;padding:10px;">

		<button type="buton" onclick="return submitComment();">提交留言</button>
	</div>
</form>


<div class="ui-content format-exp" style="padding-top:0">
	<div class="title">
		<h4>事件编号：${model.code}</h4>
	</div>
	<ol class="exp-conent-orderlist">
		<li class="exp-content-list list-item-1"><div class="list-icon">1</div>
			<div class="content-list-text">事件登记</div>
			<div class="content-list-media">${descStep1}</div>
		</li>
		<li class="exp-content-list ${step2 }"><div class="list-icon">2</div>
			<div class="content-list-text">分派工程师</div>
			<div class="content-list-media">${descStep2 }</div></li>
		<li class="exp-content-list ${step3 }"><div class="list-icon">3</div>
			<div class="content-list-text">工程师响应</div>
			<div class="content-list-media">${descStep3 }</div></li>
		<li class="exp-content-list  ${step4 }"><div class="list-icon">4</div>
			<div class="content-list-text">工程师到场</div>
			<div class="content-list-media">${descStep4 }</div>
		</li>
		<li class="exp-content-list ${step5 }"><div class="list-icon">5</div>
			<div class="content-list-text">问题解决</div>
			<div class="content-list-media">${descStep5 }</div></li>
		<li class="exp-content-list ${step6 }"><div class="list-icon">6</div>
			<div class="content-list-text">事件关闭</div>
			<div class="content-list-media">${descStep6 }</div></li>
	</ol>
</div>
